package bean;

import joinery.DataFrame;
import tool.Lg;

import java.util.*;

public class DataFrameContainer {
    private Map<Object,Integer> headMap = new HashMap<>();
    private DataFrame<String> dataFrame;

    public DataFrameContainer(DataFrame<String> dataFrame) {
        this.dataFrame = dataFrame;
        Set<Object> columns = this.dataFrame.columns();
        List<Object> head = new ArrayList<>(columns);
        for (Object o:columns)
        {
            headMap.put(o,head.indexOf(o));
//            Lg.info(o);
        }
    }
    public int indexOfCol(Object o)
    {
        if (headMap.containsKey(o))
        {
            return headMap.get(o);
        }
        return -1;
    }
}
